package com.java.a01InetAddressDemo;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class MyInetAdressDemo1 {
    public static void main(String[] args) throws UnknownHostException {
        //1.获取InetAddress对象
        InetAddress address = InetAddress.getByName("LK-9I2IF8OA");
        System.out.println(address);

        String name = address.getHostName();
        System.out.println(name);

        String ip = address.getHostAddress();
        System.out.println(ip);
    }
}
